<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
	
	<head>
		<title>微商后台管理系统-权限列表</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
		<link rel="icon" type="image/ico" href="/assets/images/favicon.ico" />
		<object th:remove="tag" th:include="admin/include/css-header :: css-header"></object>
		<object th:remove="tag" th:include="admin/include/js-header :: js-header"></object>
		<!-- DataTabel --> 	
	    <link rel="stylesheet" href="/assets/js/vendor/chosen/css/chosen.min.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/chosen/css/chosen-bootstrap.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/datatables/css/dataTables.bootstrap.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/datatables/css/ColVis.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/datatables/css/TableTools.css"/>
	</head>
	
	<body class="bg-3">
    <!-- 遮罩 -->
    <div class="mask"><div id="loader"></div></div>
    <!--/遮罩 -->
    <!-- 主体内容  -->
    <div id="wrap">
      <div class="row">
        <!-- 头部 和 左侧菜单 -->
        <object th:remove="tag" th:include="admin/include/header :: header"></object>
        <!-- /头部 和 左侧菜单 -->
        <!-- 中间内容 -->
        <div id="content" class="col-md-12">
          <!-- 中间内容头部 -->
          <div class="pageheader">
            <h2><i class="fa fa-lightbulb-o" style="line-height: 48px;padding-left: 0;"></i> 权限列表  <span></span></h2>
            <div class="breadcrumbs">
              <ol class="breadcrumb">
                <li><a href="/admin">首页</a></li>
                <li>权限列表</li>
              </ol>
            </div>
          </div>
          <!-- /中间内容头部 -->
          <!-- 中间内容主体 -->
          <div class="main">
            <div class="row">
              <div class="col-md-12">
                <section class="tile transparent">
                  <div class="tile-header transparent">
                    <h1><strong>使用技巧</strong>  </h1>
                    <span class="note">手机端：<span class="italic">使用2根指头左右滑动拖拽表格</span></span>
                    <div class="controls">
                      <a href="javascript:void(0)" class="minimize"><i class="fa fa-chevron-down"></i></a>
                      <a href="javascript:void(0)" class="refresh"><i class="fa fa-refresh"></i></a>
                      <a href="javascript:void(0)" class="remove"><i class="fa fa-times"></i></a>
                    </div>
                  </div>
                  <div class="tile-body color transparent-black rounded-corners">
                    <div class="table-responsive">
                      <table  class="table table-datatable table-custom" id="tabel">
                        <thead>
                          <tr>
                      			<th>权限名称</th>
								<th>权限内容</th>
								<th>关联地址</th>
								<th>权限配置</th>
								<th>操作</th>
                          </tr>
                        </thead>
                         <tbody>
								<tr th:each="permission, iterStat:${permissions}">
									<th th:text="${permission.intro}"></th>
									<th th:text="${permission.permissionname}"></th>
									<th th:text="${permission.path}"></th>
									<th th:text="${permission.content}"></th>
									<th class="col-md-2 control text-center">
										<a  th:href="@{/admin/permission/edit/__${permission.id}__}" class="btn btn-blue btn-sm">修改</a>
										<a  th:onclick="'javascript:deleteContent('+${permission.id}+');'" href="javascript:void(0)" class="btn btn-red btn-sm">删除</a>
									</th>
								</tr>
					   	</tbody>
                      </table>
                    </div>
                  </div>
                </section>
              </div>
            </div>
          </div>
  	    <!-- /中间内容主体 -->
        </div>
        <!-- /中间内容 -->
      </div>
    </div>
	<!-- /主体内容  -->
	<object th:remove="tag" th:include="admin/include/js-footer :: js-footer"></object>
    <object th:remove="tag" th:include="admin/include/flashMessage :: flashMessage"></object>
	
	<!-- datatabel -->
    <script src="/assets/js/vendor/datatables/jquery.dataTables.min.js"></script>
    <script src="/assets/js/vendor/datatables/ColReorderWithResize.js"></script>
    <script src="/assets/js/vendor/datatables/colvis/dataTables.colVis.min.js"></script>
    <script src="/assets/js/vendor/datatables/tabletools/ZeroClipboard.js"></script>
    <script src="/assets/js/vendor/datatables/tabletools/dataTables.tableTools.min.js"></script>
    <script src="/assets/js/vendor/datatables/dataTables.bootstrap.js"></script>
    <script src="/assets/js/vendor/chosen/chosen.jquery.min.js"></script>
	<script src="/admin/js/common/datatable.js"></script>
	
	<script>
		jQuery(document).ready(function() {
			EditableTable.init();
			var addRowLink = '<a href="/admin/permission/add" id="addRow" class="btn btn-blue btn-xs add-row">添加权限</a>'
            $('#tabel_wrapper').append(addRowLink);
		});
		function deleteContent(id){
			if(id){
				deleteItem("确定删除？", function(){
					window.location.href = "/admin/permission/delete/" + id;
				});
			}			
		}
	</script>

  </body>
	
</html>